package GlavFinans::Module::Content;

use Modern::Perl;

use Data::Dumper;
use Mojo::Base 'Mojolicious';
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::Loader;

has 'app';
has config => sub {{}};
has name => 'Content';

sub register {
	my ($self, $app, $conf) = @_;
	
	$app->routes->namespace('GlavFinans::Module::Content::Controller');
	
	my $r = $app->routes->bridge->to( namespace => 'GlavFinans::Module::Core::Controller',
							 controller => 'Auth', 
							 action => 'checkSession');	
	
	$r->route('/content/:name')->to( namespace => 'GlavFinans::Module::Content::Controller',
									 controller => 'Page', 
									 action => 'view', 
									 name => 'index' )->name('content_view');
}
	
	
1;